{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1190272e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-05T05:28:58.179915Z",
     "start_time": "2022-07-05T05:28:56.553474Z"
    }
   },
   "outputs": [],
   "source": [
    "enable_plotly_in_cell()\n",
    "\n",
    "import akshare as ak\n",
    "\n",
    "#sw_index_spot_df = ak.sw_index_spot()\n",
    "sw_index_spot_df = ak.sw_index_second_spot()\n",
    "sw_index_spot_df['涨跌幅'] = sw_index_spot_df.最新价 / sw_index_spot_df.今开盘 - 1\n",
    "# Step: Sort column(s) 涨跌幅 ascending (A-Z)\n",
    "sw_index_spot_df = sw_index_spot_df.sort_values(by=['涨跌幅'], ascending=[False])\n",
    "sw_index_spot_df\n",
    "# sw_index_spot_df.iplot(kind='bar', x='指数名称', y='涨跌幅', orientation='h')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "4e79b2f9",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-16T08:34:50.131072Z",
     "start_time": "2022-07-16T08:34:49.398484Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "            净值日期    累计净值\n",
      "0     2002-09-20  1.0000\n",
      "1     2002-09-23  1.0000\n",
      "2     2002-09-24  1.0000\n",
      "3     2002-09-25  1.0000\n",
      "4     2002-09-26  1.0000\n",
      "...          ...     ...\n",
      "4825  2022-07-11  4.0243\n",
      "4826  2022-07-12  4.0214\n",
      "4827  2022-07-13  4.0212\n",
      "4828  2022-07-14  4.0210\n",
      "4829  2022-07-15  4.0162\n",
      "\n",
      "[4830 rows x 2 columns]\n"
     ]
    }
   ],
   "source": [
    "import akshare as ak\n",
    "\n",
    "fund_open_fund_info_em_df = ak.fund_open_fund_info_em(fund=\"202101\", indicator=\"累计净值走势\")\n",
    "print(fund_open_fund_info_em_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "56dd1190",
   "metadata": {},
   "outputs": [],
   "source": [
    "from quant.data import jisilu\n",
    "import akshare as ak\n",
    "df = ak.bond_cb_jsl(cookie='; '.join(list(map(lambda kv: '='.join(list(kv)), jisilu.auth().cookies.get_dict().items()))))\n",
    "df"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:quant] *",
   "language": "python",
   "name": "conda-env-quant-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
